<template>
  <div class="photo">
    <div class="photo_item">
      <div class="photo_item-title">{{item.entname}}</div>
      <div class="photo_item-info">
        <span>
          业务类型：{{item.opertype | dict('CD01')}}
        </span>
        <span>
          申请时间：{{item.appdate}}
        </span>
      </div>
    </div>
    <div class="photo_middle">
      <p>业务提交后，经工商登记工作人员审核，被退回修改的，需重新提交，提交时仍需法定代表人和全体股东对申请内容进行确认。</p><br/>
      <p>您可以选择授权被委托人（经办人）代为确认。被委托人（经办人）的确认行为等同于您的确认行为。</p>
      <br/>
      <div style="border-bottom: 3px solid #eaeaea"></div><br/>
      <p>请确认是否授权被委托人（经办人）在后续的业务办理过程中对企业基本信息、股东信息、董事、经理、监事信息、住所产权证明文件、公司章程等进行修改。</p>
      <br/><br/>
      <div style="text-align: center;">
        <Checkbox trueValue="1" falseValue="2" v-model="isAuth" >
          <span style="font-size: 20px;">确认授权</span>
        </Checkbox>
      </div>
    </div>
    <div class="photo_bottom">
      <div class="bottom">
    <Button type="primary" @click="sure">确认</Button>
  </div>
      <MyFooter />
    </div>
  </div>
</template>

<script>
  import MyFooter from '../../components/MyFooter.vue'
  import request from '../../utils/request'
  export default {
    data() {
      return {
        item: {},
        isAuth: '2'
      }
    },
    components: {
      MyFooter
    },
    methods: {
      sure() {
        request.get('/interface/confirm/updateAssign.do', {'confirmid': this.item.confirmid, 'assign': this.isAuth}
        ).then(response => {
          if (response.data.result === 'error') {
            this.$ErrorAlert(response.data.message)
            return null
          }
          // 成功逻辑
          this.$router.push({name: 'BusinessConfirmSign'})
        })
      },
      initHtml() {
        this.item = JSON.parse(sessionStorage.getItem('confirm'))
        request.get('/interface/confirm/queryAssign.do', {'confirmid': this.item.confirmid}
        ).then(response => {
          if (response.data.result === 'error') {
            this.$ErrorAlert(response.data.message)
            return null
          }
          // 成功逻辑
          this.isAuth = response.data.data
        })
      }
    },
    mounted() {
      this.initHtml()
    }
}
</script>

<style lang="scss" scoped>
  .photo {
    position: relative;
    height: 100%;
    background: #f3f3f3;
    // padding-bottom: 4rem;
    &_item {
      padding: 0.54rem;
      background: #fff;
      // height: 20%;
      &-title {
        color: #00ADFF;
        overflow: hidden;
        white-space: nowrap;
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 0.22rem;
        margin-bottom: 0.14rem;
      }
      &-info {
        display: flex;
        justify-content: space-between;
        font-size: 0.5rem;
        color: #7d7d7d;
        overflow: hidden;
        white-space: nowrap;
        padding: 0.36rem 0;
      }
    }
    &_pic {
      padding: 5%;
      img {
        width: 100%;
      }
    }
    &_middle {
      width: 96%;
      height: 60%;
      margin: 0 2%;
      overflow-y: hidden;
      p {
        text-indent:2em;
        line-height: 20px;
      }
    }
    &_bottom {
      width: 100%;
      height: 15%;
      bottom: 0;
    }
    .bottom {
      margin: 0 25vw;
      button {
        background-color: #00ADFF;
        width: 50vw;
        vertical-align: middle;
        line-height:22px;
        padding-top: 0.36rem;
        padding-bottom: 0.36rem;
        font-size: 0.57rem;
      }
    }
  }

</style>
